﻿@model IEnumerable<ElCharro01.Models.Variant>
@{
    ViewBag.Title = "ShowVariantOfProduct";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}
<div class="paddalo">
    <h2 class="centered">
        Gestione Varianti->Gestisci Varianti Del Prodotto @ViewBag.ProductName
    </h2>
    <div>
        @using (Html.BeginForm("ShowVariantOfProduct", "Variant", new { ProductID = ViewBag.ProductID }))
        {
            <div>
                Taglia:
                @Html.DropDownList("Size", new SelectList(ViewBag.SizeVariants), "Tutte", new { })
                Colore:
                @Html.DropDownList("Colour", new SelectList(ViewBag.ColourVariants), "Tutti", new { })
                <input type="submit" value="Filtra" />
            </div>
        }
    </div>
    <p>
        @Html.ActionLink("Crea Nuova Variante Per Questo Prodotto", "Create", new { id = ViewBag.ProductID })
    </p>
    <div>
        <table>
            <tr>
                <th>
                    Colore
                </th>
                <th>
                    PrezzoUnitario
                </th>
                <th>
                    Taglia
                </th>
                <th>
                    InStock
                </th>
                <th>
                    Immagine
                </th>
                <th>
                </th>
            </tr>
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.Colore)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.PrezzoUnitario)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Taglia)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.InStock)
                    </td>
                    <td>
                        <a href="@Url.Action("Edit", "Variant", new { id = item.ID })">
                            <img width="110" height="110" src="/Content/Images/Raw/@item.Image.First().Path" alt="@item.Product.Nome" /></a>
                    </td>
                    <td>
                        @Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
                        @Html.ActionLink("Elimina", "Delete", new { id = item.ID })
                    </td>
                </tr>
            }
        </table>
    </div>
</div>
<div class="centralo">
    @Html.ActionLink("Torna Indietro", "Index", "Product")
</div>
